class Category < ActiveRecord::Base
  
    attr_accessible :name, :description, :order_position, :parent, :parent_id, :subcategories, 
		:documents, :created_by, :updated_by
	
	translates :name, :description
	
    # Validations:
	#TODO: Validate for only one language
	#validates :name, presence: true 
	validates :order_position, allow_blank: true, numericality: { only_integer: true }
    
    # Relationships:
    has_and_belongs_to_many :documents
	
	has_ancestry
	
end
